package com.czr.schedule;//package com.wenge.data.schedule;
//
//import com.google.common.collect.Maps;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.annotation.EnableScheduling;
//import org.springframework.scheduling.annotation.SchedulingConfigurer;
//import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
//import org.springframework.scheduling.config.ScheduledTaskRegistrar;
//
//import java.util.concurrent.Executor;
//
//// todo   代码不可以提交  用来取消本地开发环境所有定时任务
//@Slf4j
//@Configuration
//@EnableScheduling
//public class ScheduleConfig implements SchedulingConfigurer {
//
//
//    @Override
//    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
//        //清空扫描到的定时任务即可
//        taskRegistrar.setTriggerTasks(Maps.newHashMap());
//        taskRegistrar.setCronTasks(Maps.newHashMap());
//        taskRegistrar.setFixedRateTasks(Maps.newHashMap());
//        taskRegistrar.setFixedDelayTasks(Maps.newHashMap());
//        taskRegistrar.setScheduler(taskExecutor());
//        log.info("===================》》本地开发环境所有定时任务已经取消");
//    }
//
//    @Bean(destroyMethod = "shutdown")
//    public Executor taskExecutor() {
//        ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
//        taskScheduler.setPoolSize(10);
//        taskScheduler.initialize();
//        return taskScheduler;
//    }
//}
